<?php global $ubi;?>
<div class="organicContent">
<?php
	if ($interactType == $ubi['PROVIDER']['VALUE']) {
		$urlRemoveFavourite = "index.php?provider&action=removeFavourite"; 
?>
		<h2 class="header">YÊU THÍCH QUÁN XÁ</h2>
		<div class="inside">
		<?php
			for ($i = 0; $i < count($favList); $i++) {
				$provider = $favList[$i];
			?>
				<div>
					<a href="index.php?view&type=provider&id=<?php echo $provider->getProviderID()?>">
						<?php echo $provider->getProvider(); ?>
					</a>
					<a href="#favProvider" title="Gỡ bỏ" 
						onclick="$.delFavouriteProvider('<?php echo $provider->getProviderID() ?>','<?php echo $provider->getProvider() ?>','<?php echo $urlRemoveFavourite?>')">
						<img src="include/images/icons/circle-delete.png"/>
					</a>
				</div>								
			<?php 
			} 
		?>	
		</div>
<?php
	} else {
		$urlRemoveFavourite = 'index.php?item&action=removeFavourite';
?>
		<h2 class="header">YÊU THÍCH MÓN ĂN</h2>
		<div class="inside">
		<?php						
			for ($i = 0; $i < count($favList); $i++) {
				$item = $favList[$i];
			?>
				<div>
					<a href="index.php?view&type=item&id=<?php echo $item->getItemID()?>">
						<?php echo $item->getItem(); ?>
					</a>
					<a href="#favItem" title="Gỡ bỏ"
						onclick="$.delFavouriteItem('<?php echo $item->getItemID() ?>','<?php echo $item->getItem() ?>','<?php echo $urlRemoveFavourite?>')">
						<img src="include/images/icons/circle-delete.png"/>
					</a>
				</div>
			<?php 
			} 
		?>	
		</div>
<?php  
	}
?>	
</div>
<script language="javascript" type="text/javascript">
	$('.organicContent').corner("5px");
	$('h2.header').corner("top 5px");	

	$.extend({
		delFavouriteItem:function(id, name, url) {			
			$.removeFavouriteItem(id, name, url);
			$('#favItem').load('index.php?load&view=favouriteItems&userid=<?php echo $getVars['userid']?>');
		},
		delFavouriteProvider:function(id, name, url) {			
			$.removeFavouriteProvider(id, name, url);
			$('#favProvider').load('index.php?load&view=favouriteProviders&userid=<?php echo $getVars['userid']?>');
		}
	});
</script>